﻿using BW.MesProject.Public.Application.DocCode;
using BW.MesProject.Public.Application.Dto.Input;
using BW.MesProject.Public.Application.Dto.Output.DocCode;
using BW.MesProject.Public.Domain.Model;
using BW.MesProject.Public.ErrorCode;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace BW.MesProject.Public.Host.Controllers
{
    /// <summary>
    /// 单据字典编码控制器
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class DocCodeController : ControllerBase
    {
        private readonly IDocServices _docServices;

        public DocCodeController(IDocServices docServices)
        {
            _docServices = docServices;
        }
        /// <summary>
        /// 添加单据字典编码
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public ApiResult<int> CreateDocCode(DocInput input)
        {
            return _docServices.CreateDocCode(input);
        }
        /// <summary>
        /// 获取单据字典编码列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public ApiResult<List<DocCodeOutput>> GetDocCodeList()
        {
            return _docServices.GetDocCodeList();
        }
    }
}
